 //*************************************************************
 // PP52.java              Author:20172323wyh
 //
 // Test two and more years in one time.
 //*************************************************************

 import java.util.Scanner;

 public class PP52
 {
    public static void main(String[] args)
    {
       String another = "y";

       Scanner scan1 = new Scanner(System.in);
       Scanner scan2 = new Scanner(System.in);

       while (another.equalsIgnoreCase("y"))
       {
         System.out.print("Enter the years: ");
         int year = scan1.nextInt();
         System.out.println();

         if (year < 1582)
            System.out.println("Unfairly input");
         else
            if ((year%4) == 0)
               {
                if ((year%100) != 0 || ((year%100) == 0 && (year%400) == 0) )
                   System.out.println("This is a leap year");
                else
                   System.out.println("This isn't a leap year");
               }
            else
                System.out.println("This isn't a leap year");
       
         System.out.println();
         System.out.println("Test another year (y/n)? ");
         another = scan2.nextLine();
        }
     }
 }

